# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgbase=radare2-r2pipe
pkgname=(python-r2pipe)
pkgver=5.7.2
pkgrel=2
pkgdesc='Access radare2 via pipe from any programming language'
url='https://github.com/radareorg/radare2-r2pipe'
arch=('any')
license=('MIT')
makedepends=(
  radare2
  python
  python-build
  python-installer
  python-setuptools
  python-wheel
  python-sphinx
)
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha512sums=('66abc418b8cdc8b64494a78b5227caa8ef7428f64752653313fa878736a5d98bf14a6d3b48a77b19b8cac7dd8babb5cf6955c6644b95bb49e2dbd10326711520')
b2sums=('c31c11ad1504ea583a4778df1a2b3a960e8ad758cc41b1620459015e5dbf71a6ad6d87c7ef0a0fd300a9cdff39ea24c08680a2c299aba04268ba7ecc93b88f03')

build() {
  cd radare2-r2pipe-${pkgver}/python
  python -m build --wheel --no-isolation
}

package_python-r2pipe() {
  depends=('python' 'radare2')
  cd radare2-r2pipe-${pkgver}/python
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
